<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Game_manager extends CI_Controller {
	
	function __construct() 
	{
		parent::__construct();
		$this->load->model('Game_manager_model');
	}
	
	public function index()
	{
		
		
	}	
	
	public function generate_game()
	{
		$this->template->title('Jogos Unity', 'Cadastrar Jogo');
		$this->template
			->set_layout('manager') 
			->build('manager/cadastrar_jogo');
	}
	
	public function list_games()
	{
		$games['records'] = $this->Game_manager_model->list_records();		
		
		$this->template->title('Jogos Unity', 'Listar Jogos');
		$this->template
			->set_layout('manager') 
			->build('manager/listar_jogos', $games);
		
	}
	
	//CRUD DA ADMINISTRAÇÃO DE GAMES//	
	public function create_game()
	{
		$game = array(
			'name' => $this->input->post('name'),
			//'infoExtra' => $this->input->post('infoExtra'),
			'description' => $this->input->post('descricao'),
		 	'embed' => $this->input->post('embed')
		);
		$this->Game_manager_model->create_receord($game);
		
		/*
		$game_cat = array(		
		 	'tags' => $this->input->post('categorias'),
		);	
		$game_tags = array(		
		 	'tags' => $this->input->post('tags'),
		);		 
		*/
		
	}
	
	public function read_game()
	{
		
		
	}
	
	public function update_game()
	{
		
		
	}
	
	public function delete_game()
	{
		
		
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */


